<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
<script type="text/javascript">

function save(){
	var str_data=$("#tradeinfo input").map(function(){
		   return ($(this).attr("name")+'='+$(this).val());
		 }).get().join("&") ;
    $.ajax({
        url:"${ctx}/appFrameTrade/saveAppTradePrivate",
        type: "POST",      
        dataType:"json",
        data: str_data,
        async: false,
        success: function(data) {
        	if(data.flag>0){
	            alert("保存成功！");	
	            //window.location.reload();
        	}
        },
        error: function() {
          alert("error");
        }
      });
	
}

function  goBack(){
	window.history.back(-1);

}
</script>
</head>
<body>
<div class="panel panel-default">
	<div class="panel-heading">
		<h3 class="panel-title">
          创建交易基本信息
		</h3>
	</div>
	<div class="panel-body">
		<form class="form-horizontal" role="form" id="tradeinfo">
			<div class="form-group">
				<label class="col-xs-2 control-label" for="appId">应用标识</label>
				<div class="col-xs-4">
					<input class="form-control" id="appId" name="appId" type="text" readonly="readonly" value="${appid}"/>
				</div>
				<label class="col-xs-2 control-label" for="tradeId">交易标识<font color="red">*</font></label>
				<div class="col-xs-4">
					<input class="form-control" id="tradeId" name="tradeId" type="text" value="${str[1]}" placeholder="交易唯一标识,主键,按应用标识+2位或3位顺序号的格式进行编码"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-2 control-label" for="tradeCode">交易码<font color="red">*</font></label>
				<div class="col-xs-4">
					<input class="form-control" id="tradeCode" name="tradeCode" type="text" value="${str[0]}" placeholder="交易码,用于在渠道中与其它系统交互"/>
				</div>
				<label class="col-xs-2 control-label" for="forwardChannelId">转发渠道标识<font color="red">*</font></label>
				<div class="col-xs-4">
					<input class="form-control" id="forwardChannelId" name="forwardChannelId" type="text" value="${str[1]}" placeholder="通过哪个渠道进行交易转发"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-2 control-label" for="tradeName">交易名称<font color="red">*</font></label>
				<div class="col-xs-4">
					<input class="form-control" id="tradeName" name="tradeName" type="text" value="" placeholder=""/>
				</div>
				<label class="col-xs-2 control-label" for="s_isUseBaffle">是否使用档板<font color="red">*</font></label>
				<div class="col-xs-4">
                             <select id="s_isUseBaffle" class="form-control">
                             	<option value='N'>否</option>
                             	<option value='Y'>是</option>
                             </select>
				</div>							
			</div>
			<div class="form-group">
				<label class="col-xs-2 control-label" for="tradeDesc">交易描述</label>
				<div class="col-xs-4">
					<textarea  class="form-control" id="tradeDesc" name="tradeDesc" rows="5"></textarea>
				</div>
				<label class="col-xs-2 control-label" for="tradeOutFormat">交易档板数据</label>
				<div class="col-xs-4">
					<textarea  class="form-control" id="tradeOutFormat" name="tradeOutFormat" rows="5"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-2 control-label" for="pageId">归属页面</label>
				<div class="col-xs-4">
					<input class="form-control" id=""pageId"" name=""pageId"" type="text" value="" placeholder="可指定该交易使用的页面标识"/>
				</div>	
			</div>
			<div class="form-group text-center">
				<button type="button" class="btn btn-default" onclick="save();">保存</button>
				<button type="button" class="btn btn-default" onclick="goBack()">返回</button>
			</div>
		</form>
	</div>
</div>
</body>
</html>
